USE [HR_DB]
GO
if exists(select * from dbo.sysobjects where id = object_id(N'config_public_char')   and   OBJECTPROPERTY(id,   N'IsUserTable')   =   1)   
  drop table config_public_char  
-- =============================================
-- Author:杨洁(kaixuanpisces)
-- Create date: 20090804
-- Description:公共字段设置
-- (包括薪酬设置，职称设置，国籍，民族，宗教信仰，
-- 政治面貌，教育年限，学历,专业，特长，爱好，
-- 培训项目，培训成绩，奖励项目，奖励等级)
-- =============================================
CREATE TABLE [dbo].[config_public_char](
	[pbc_id] [smallint] IDENTITY(1,1) NOT NULL,
	[attribute_kind] [varchar](60) NULL,
	[attribute_name] [varchar](60) NULL,
 CONSTRAINT [config_public_char_PK] PRIMARY KEY CLUSTERED 
(
	[pbc_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
-- ==============================================
-- 列名说明
-- ==============================================
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键，自动增长列' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'config_public_char', @level2type=N'COLUMN',@level2name=N'pbc_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'属性的种类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'config_public_char', @level2type=N'COLUMN',@level2name=N'attribute_kind'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'属性的名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'config_public_char', @level2type=N'COLUMN',@level2name=N'attribute_name'
-- ===============================================
-- 测试数据
-- ===============================================
insert into config_public_char values('国籍','中国')
insert into config_public_char values('国籍','美国')
insert into config_public_char values('民族','汉族')
insert into config_public_char values('民族','回族')
insert into config_public_char values('宗教信仰','无')
insert into config_public_char values('宗教信仰','佛教')
insert into config_public_char values('政治面貌','党员')
insert into config_public_char values('政治面貌','群众')
insert into config_public_char values('教育年限','12')
insert into config_public_char values('教育年限','16')
insert into config_public_char values('学历','本科')
insert into config_public_char values('学历','大专')
insert into config_public_char values('专业','生物工程')
insert into config_public_char values('专业','计算机')
insert into config_public_char values('特长','数据库')
insert into config_public_char values('特长','java')
insert into config_public_char values('爱好','篮球')
insert into config_public_char values('爱好','舞蹈')
insert into config_public_char values('培训项目','英语')
insert into config_public_char values('培训项目','管理')
insert into config_public_char values('培训成绩','A')
insert into config_public_char values('培训成绩','B')
insert into config_public_char values('奖励项目','技术攻关')
insert into config_public_char values('奖励项目','销售绩效')
insert into config_public_char values('奖励等级','A')
insert into config_public_char values('奖励等级','B')
insert into config_public_char values('职称','工程师')
insert into config_public_char values('职称','经理')
insert into config_public_char values('职称','助理')
insert into config_public_char values('职称','教授')
insert into config_public_char values('职称','讲师')
insert into config_public_char values('职称','技术支持')
insert into config_public_char values('薪酬设置','出差补助')
insert into config_public_char values('薪酬设置','交通补贴')
insert into config_public_char values('薪酬设置','住房补贴')
insert into config_public_char values('薪酬设置','基本工资')
insert into config_public_char values('薪酬设置','年终奖')
insert into config_public_char values('薪酬设置','误餐补助')